{include file="file:../../../templates/header.tpl"}
{literal}
<script language="javascript">
	function storeF(elem){
		var d =  $("#fid").attr("value");
		$("#fid").attr("value",elem);
		$("#simple_f"+d).hide();
		$("#link_f"+d).show();
		$("#simple_f"+elem).show();
		$("#link_f"+elem).hide();
		$.get("ajax/ajax_getcategories.php",{fid:elem},changeCats);
	}
	function changeCats(data){
		
		$("#cid").children().remove();
		$("#cid").html(data);
	}
	function check(){
		$(form).submit();
	}
</script>
{/literal}
  {* body *}
<table>
<tr><td width="100px">
<div id="fmenu" style="padding-left:10px;">
<p><h2>Select Faculty:</h2></p>
<form name="test" action="index.php?option=mainpage&task=runtest" method="post">
<ul>
	<li>
		<div id="simple_f0" style="display:{if $smarty.session.fselected == 0}inline;{else}none;{/if}">Any</div>
		<div id="link_f0" style="display:{if $smarty.session.fselected == 0}none;{else}inline;{/if}">
			<a href="#" onclick="storeF({0}); return false;">Any</a>
		</div>
	</li>	
{foreach from=$faculties key=k item=v}
   <li>
   		<div id="simple_f{$k}" style="display:{if $smarty.session.fselected == $k}inline;{else}none;{/if}">{$v}</div>
		<div id="link_f{$k}" style="display:{if $smarty.session.fselected == $k}none;{else}inline;{/if}">
			<a href="#" onclick="storeF({$k}); return false;">{$v}</a>
		</div>
	</li>
{/foreach}
</ul>
<p><h2 style="padding-bottom:10px;" >Select Subject:</h2></p>
<pre id="cid" >
{html_radios name='cid' values=$categories[0] output=$categories[1]}
</pre>
<input type="hidden" id="fid" name="fid" value="{$smarty.session.fselected}" />
<div id="leftPango" style="width:inherit">
<input class="submit" type="submit" value="start test" onclick="check()" />
</div>
</form>

</div>

</td><td valign="top">
<div style="height:50px"></div>
<div id="zeroPan">
<div id="zerobodyPan">
 <h2> Welcome to PGK Testing system </h2>
 <p>Select one of subjects to create quiz and then you will be able to take it.</p>
 <br />
 
</div>
</div>
</td></tr></table>
{include file='file:../../../templates/footer.tpl'}